function doy=dayofyear(day)
% function doy=dayofyear(day)
% day must be a datenum
% bcoe
if nargin ==0 
    day=now;
end
doy=floor(day-datenum(['01-01-' datestr(day,'yyyy')]));

